var time;
var Carousel=document.getElementById("Carousel");
var s=-2000;
time = setInterval(fun, 20);
function fun() {
	s = s - 20;
	Carousel.style.left = s + "px";
	if (s < -10000) {
		s = 0;
	} else if (s % 2000 == 0) {
		clearInterval(time);
		setTimeout(function() {
			time = setInterval(fun, 30);
		}, 1000);

	}
}


var left=document.getElementById("left");
var right=document.getElementById("right");
left.onclick = function() {
	s = s + 2000;
	if (s >= 0) {
		s = -10000;

	}
	Carousel.style.left = s + "px";
}

right.onclick = function() {
	s = s - 2000;
	if (s <= -10000) {
		s = 0;
	}
	Carousel.style.left = s + "px";

}

function xianshi() {
	left.style.display = 'block';
	right.style.display = 'block';
}

function xiaoshi() {
	left.style.display = 'none';
	right.style.display = 'none';
}